<?php include "../../config.php";?>
<?php include ROOT_PATH_."/front/m2/coresection/checkUserSession.php";?>
<?$site     = select_one_line_all_items($table_Prefix."site","nid !='-1' ");?>

<?
if(date("H")<10){$at="1";}
elseif(date("H")>16){$at="3";}
else{$at="2";}
?>

<? $orderlist=select_lines_all_items($table_prefix."orderlist","","order_date ='".date("Y-m-d")."' and order_at ='$at' and (status != '取消' or status is null) ",""); ?>
<?
$orderlist_1d=transform_2darray_in_1darray_number_as_key($orderlist,"search_status");
$condition['data']=$orderlist_1d;
$condition['rang']="";
$condition['target']="0";

$noteaten=count_num_in_array($condition);
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>邮政点餐系统</title>  
 
	
<style>
 ol {margin:1px;font-size:25px; padding:15px;} 
ol li{ border:solid 1px #cccccc;float:left;list-style-position:inside; width:160px}
.used{ background-color:#666666; color:#ffffff}
.take_away{float:left; margin-left:55px;background-color:#060;color:#ffffff}
.infos{ width:100%;font-size:22px; clear:both; padding:0; }
.infos h1{  text-align:center; font-size:30px; border-bottom:solid 1px #cccccc;    padding: 0px;
    margin: 0px 0px 25px 0px;
    line-height: 47px;}
</style>

</head>

<body style="margin:0px">

<div class="infos">
<h1>就餐详情</h1>
 <span style="float:left; margin-left:35px;">当前时间:

  <?switch($at){
   case 1:
    echo "早餐";
    break;
   case 2:
    echo "午餐";
    break;
   case 3:
    echo "晚餐";
    break;
  }
  ?>
 </span>
 <span style="float:left; margin-left:55px; border:solid 1px #666666">未就餐订单数:<? echo $noteaten?></span>
 <span style="float:left; margin-left:55px;background-color:#666666; color:#ffffff">已就餐订单数:<? echo count($orderlist)-$noteaten ?></span>
 <span style="float:left; margin-left:55px;">总就餐订单数:<? echo count($orderlist) ?></span>
<div>
<br/>
<ol>
<? for($_i=0;$_i<count($orderlist);$_i++) {

if($search_diliver[$_i]=="配送")
{
 $takeaway="take_away";

}
 else{
  $takeaway="";
 }



//外带的客户也有在饭堂就餐的可能,所以就餐和没就餐的，需要单独再写
if($orderlist[$_i]['search_status']==0)
{$status="notused";}
else
{
$status="used";
}

?>
 
 <li class="<? echo $status ?> <?echo $takeaway?>">
  <? echo $orderlist[$_i]['user_name'] ?></li>
 <?;} ?>
 </ol>


 <?php include 'modules/footer.php'; ?>
</body>
</html>